<script lang="ts" setup>
import { defineProps } from "vue"

defineProps<{
  title: string
  url: string
  intro?: string
  textBg?: string
}>()
</script>

<template>
  <a class="myProject" target="__blank" :href="url">
    <div class="left">
      <div class="textBg">{{ textBg ? textBg.toUpperCase() : title[0].toUpperCase() }}</div>
    </div>
    <div class="right">
      <div class="title">{{ title }}</div>
      <div class="intro">{{ intro }}</div>
    </div>
  </a>
</template>

<style lang="scss" scoped>
.myProject {
  width: 350px;
  height: 90px;
  max-width: 350px;
  max-height: 90px;
  display: flex;
  box-sizing: border-box;
  margin-bottom: var(--bottom);
  transition: all 0.3s var(--n-bezier);
  &:hover {
    transform: translateY(-10px);
  }
  &:hover .left {
    box-shadow: 0 0 10px #7878781a, 0 5px 20px #78787833;
  }
  .left {
    width: 100px;
    background: var(--my-project-bg);
    transition: all 0.3s var(--n-bezier);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    .textBg {
      color: rgb(255, 255, 255);
      font-size: 44px;
    }
  }
  .right {
    width: 0;
    flex: 1;
    color: var(--TextColor);
    transition: var(--basic-transition);
    overflow: hidden;
    text-overflow: ellipsis;
    height: 100%;
    max-height: 100%;

    .title {
      font-size: 18px;
      color: var(--TextColor);
      transition: var(--basic-transition);
      text-overflow: ellipsis;
      overflow: hidden;
      font-weight: bold;
    }
    .intro {
      font-size: 12px;
      color: var(--TextColor);
      transition: var(--basic-transition);
      text-overflow: ellipsis;
      white-space: break-spaces;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3; /*行数*/
    }
  }
}
</style>
